package com.winbomb.kingcard.base;

import android.util.Log;

import com.winbomb.kingcard.IPlayerInfo;
import com.winbomb.kingcard.Pos;

public class PlayerInfo implements IPlayerInfo {

	/** 12个位置的营寨的坐标 */
	public static final Pos[] SEAT_POS = new Pos[] { new Pos(385, 160), new Pos(385, 112), new Pos(385, 64),
			new Pos(317, 64), new Pos(232, 64), new Pos(147, 64), new Pos(80, 64), new Pos(80, 112), new Pos(80, 160),
			new Pos(147, 160), new Pos(232, 160), new Pos(317, 160) };

	/** 姓名 */
	private String name;

	/** 座位号 */
	private int seatNum;

	/** 营帐的位置 */
	private Pos campPos;

	/** 头像区左上角的位置 */
	private Pos framePos;

	public PlayerInfo(String name, int seatNum) {
		this.name = name;
		this.seatNum = seatNum;

		this.campPos = SEAT_POS[seatNum];

		switch (seatNum) {
		case 0:
			this.framePos = new Pos(405, 158);
			break;
		case 6:
			this.framePos = new Pos(5, 5);
			break;
		case 2:
			this.framePos = new Pos(400, 5);
			break;
		case 8:
			this.framePos = new Pos(5, 176);
			break;
		case 4:
			this.framePos = new Pos(200, 5);
			break;
		case 10:
			this.framePos = new Pos(200, 176);
			break;
		case 1:
			this.framePos = new Pos(400, 88);
			break;
		case 7:
			this.framePos = new Pos(5, 88);
			break;
		case 3:
			this.framePos = new Pos(300, 5);
			break;
		case 9:
			this.framePos = new Pos(100, 176);
			break;
		case 5:
			this.framePos = new Pos(100, 5);
			break;
		case 11:
			this.framePos = new Pos(295, 176);
			break;
		default:
			Log.e("", "Unkonwn seat number(0~11 is legal), seatNum = " + seatNum);
		}
	}

	@Override
	public Pos getCampPos() {
		return this.campPos;
	}

	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public int getSeatNum() {
		return this.seatNum;
	}

	@Override
	public Pos getFramePos() {
		return this.framePos;
	}
}
